package com.xxx.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserRegisterDto {

    @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号码格式错误")
    private String mobile;

    @NotNull(message = "注册渠道不能为空")
    private Integer regChannel;

    @Length(min = 6,max = 18,message = "密码长必须在6-18之间")
    private String password;

    @Pattern(regexp = "^\\d{6}$",message = "验证码格式错误")
    private String smsCode;
}